package com.example.common.api;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.common.po.Po;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface Service<T extends Po> {

    BaseMapper<T> getMapper();

    Integer insert(T entity);

    Integer deleteById(Serializable id);

    Integer deleteByMap(Map<String, Object> columnMap);

    Integer deleteBatchIds(Collection<? extends Serializable> idList);

    Integer updateById(T entity);

    T selectById(Serializable id);

    List<T> selectBatchIds(Collection<? extends Serializable> idList);

    List<T> selectByMap(Map<String, Object> columnMap);

    T selectOne(Wrapper<T> wrapper);

    Integer selectCount(Wrapper<T> wrapper);

    List<T> selectList(Wrapper<T> wrapper);

    IPage<T> selectPage(Integer pageNum, Integer pageSize, Wrapper<T> wrapper);
}